﻿CREATE PROCEDURE [dbo].[proc_Department_Update_Protect]
	(
	@Id int,
	@Count int,
	@Type int
	)
AS
	if(@Type = 1)
		Update Department Set ProtectCount=@Count Where id=@Id
	else IF(@Type=2)
		Update Department Set ProtectDays=@Count Where id=@Id
	ELSE IF (@Type=3)
		UPDATE Department SET TrackCount = @Count WHERE id=@Id
	ELSE IF (@Type=4)
		UPDATE Department SET TrackDays = @Count WHERE id=@Id
	ELSE
		SELECT -1
	RETURN